#include "led_app.h"
#include "board_desc.h"
#include "FreeRTOS.h"
#include "task.h"
#include "main.h"
#include "cmsis_os.h"

/* Definitions for defaultTask */
osThreadId_t ledTaskHandle;
const osThreadAttr_t ledTask_attributes = {
  .name = "ledTask",
  .stack_size = 128 * 4,
  .priority = (osPriority_t) osPriorityNormal,
};

static void led_task(void)
{	
	printf("%s task creat suc\r\n", __func__);
	while(1)
	{
		set_gpio_toggle(LED_GREEN_PIN);
		set_gpio_toggle(LED_RED_PIN);
		//set_gpio_toggle(BEEP_PIN);
		//printf("led run\r\n");
		osDelay(1000);
	}
}

void led_task_creat(void)
{
	ledTaskHandle = osThreadNew(led_task, NULL, &ledTask_attributes);
}


